<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div class="pageContent">
	<form method="post" id="expressFeeForm" action="${rootUrl}/seller/express-fee/${expressFee.id}" class="pageForm required-validate" onsubmit="return validateCallback(this, editDialogAjaxDone);">
		 <c:if test="${expressFee.id != 0 && expressFee.id != '' }"><input type="hidden" name="_method" value="put"></c:if>
		<input type="hidden" name="expressFee.id" value="${expressFee.id }"> 
		<input type="hidden" name="expressId" value="${express.id}">
		<input type="hidden"  name="areaId" value="${area.id}">
		<div class="pageFormContent" layoutH="56">
			<p>
			     <label>快递名称：</label>
				<input name="expressFee.express.name"  readonly="readonly" type="text" size="30" value="${express.name}" />
			</p>
			<p>
				<label>保存级别：</label>
	             <select name="setValue" id="setValue">
	             	<option value="1">省</option>
	             	<option value="2">市</option>
	             	<option value="3">县</option>
                 </select>
			</p>
			<p class="nowrap">
				<label>区域名称：</label>
				 <select id="province" >
	             </select>
                 <select id="city" >
                 </select>
                 <select id="country" >
                 </select>
			</p>
				<p>
			     <label>默认首重(克)：</label>
				<input name="expressFee.first"  type="text" class="required number" size="30" value="${expressFee.first }" />
			</p>
			<p>
				<label>默认首重价格：</label>
				<input name="theFirstPrice"  type="text" class="required number" size="30" value="<fmt:formatNumber value="${expressFee.firstPrice/100}" pattern="0.00"/>" onfocus="if (value =='0.00'){value =''}"  
            		onblur="if (value ==''){value='0.00'}"/>
			</p>
				<p>
			     <label>默认续重(克)：</label>
				<input name="expressFee.additional"  type="text" class="required number" size="30" value="${expressFee.additional }" />
			</p>
			<p>
				<label>默认续重价格：</label>
				<input name="theAdditionalPrice"  type="text" class="required number" size="30" value="<fmt:formatNumber value="${expressFee.additionalPrice/100}" pattern="0.00"/>" onfocus="if (value =='0.00'){value =''}"  
            		onblur="if (value ==''){value='0.00'}"/>
			</p>
			
   		 </div>
    	<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button id="theSubmit" type="button" onclick="saveAreaForm()">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
    </form>
    </div>
<script type="text/javascript">
    var cselect = new iCitySelector("province", "city", "country");
	cselect.init();
	
	function saveAreaForm(){
		var setValue = $("#setValue").val();
		if (setValue == 1){
			$("#province").attr("name",'expressFee.area.id');
		}else if(setValue == 2){
			$("#city").attr("name",'expressFee.area.id');
		}else if(setValue == 3){
			$("#country").attr("name",'expressFee.area.id');
		}
		$("#expressFeeForm").submit();
	}
</script>

   
